import { createRouter, createWebHashHistory } from "vue-router";

const routers = (baseRedirect: string = "/home") =>
  createRouter({
    history: createWebHashHistory(),
    routes: [
      {
        path: "/",
        name: "Root",
        redirect: baseRedirect,
      },
      {
        path: "/home",
        name: "Home",
        component: () => import("@application/layout/index"),
        redirect: "/home/origin",
        children: [
          {
            path: "origin",
            name: "Origin",
            component: () => import("@application/view/Home/index"),
          },
        ],
      },
      {
        path: "/detail",
        name: "Detail",
        component: () => import("@application/view/Detail/index"),
      }
    ],
  });

export default routers;
